<?php

class Constant 
{

	/*
	Production or Test enviorment
	const APPLICATION_PATH_PROD = "/dil/web/";
	const APPLICATION_FRONTEND_PATH_PROD = "/dil/web/";
	const APPLICATION_BACKEND_PATH_PROD = "/dil/web/backend.php/";
	//Development Enviorment
	const APPLICATION_PATH_DEV = "/dil/web/frontend_dev.php/";
	const APPLICATION_FRONTEND_PATH_DEV = "/dil/web/frontend_dev.php/";
	const APPLICATION_BACKEND_PATH_DEV = "/dil/web/backend_dev.php/";
	*/
	
	//Production or Test enviorment
	const APPLICATION_PATH_PROD = "/frontend.php/Login/";
	const APPLICATION_FRONTEND_PATH_PROD = "/frontend.php";
	const APPLICATION_BACKEND_PATH_PROD = "/frontend.php/";
	//Development Enviorment
	const APPLICATION_PATH_DEV = "/frontend_dev.php/";
	const APPLICATION_FRONTEND_PATH_DEV = "/frontend_dev.php/";
	const APPLICATION_BACKEND_PATH_DEV = "/backend_dev.php/";
	
	//Roles Constants
	const ROLE_SUPER_ADMINISTRATOR = 1;
	const ROLE_SUPER_ADMINISTRATOR_TITLE = "Super Administrator";	
	const ROLE_ADMINISTRATOR = 2;
	const ROLE_ADMINISTRATOR_TITLE = "Administrator";	
	const ROLE_EMPLOYEE = 3;	
	const ROLE_EMPLOYEE_TITLE = "Employee";	
	
	
	//Login Constants
	const LOGIN_INVALID_USER_EMAIL_PASSWORD = "Seems like you have forgotten your USERNAME or PASSWORD";
	const LOGIN_OK = "You have successfully Logged In...";
	const LOGIN_COMPANY_DISABLED = "Hey, We know you are good but seems like you company is not good and is disabled. Contact your Administrator";
	const LOGIN_USER_DISABLED = "Well, we came to know that you are not good user and your account is disabled. Contact your Administrator";	
	const LOGIN_COMPANY_NOT_APPROVED = "Your company account have not approved by admin.";	
	const LOGIN_INVALID_OLD_PASSWORD = "Seems like you dont remember your old password";
	const LOGIN_PASSWORD_CHANGED_SUCCESS = "Your password has been changed successfully";
	const LOGIN_ACCOUNT_NOT_VERIFIED ="You have not verified your link which was sent to you email"; 
	const LOGIN_INVALIDATION_EMAIL_FIELD = "Seems like you even dont remeber you email.";
	const LOGIN_PASSWORD_SENT_SUCCESS = "Your new password has been sent to your email.";
	const LOGIN_AGAIN = "Please Login Again...";
	
	//Registration constants
	const REGISTRATION_COMPANY_ALREADY_EXIST = "Company Name already exist.";
	const REGISTRATION_COMPANY_URL_ALREADY_EXIST = "Company URL already exist.";
	const REGISTRATION_ACCOUNT_APPROVAL = "Congradulations!! Your account has been Registered Successfully.";
	const REGISTRATION_SUCCESS = "A verification email has been send to your inbox.";
	const REGISTRATION_EMAIL_ALREADY_EXIST = "This Email Already Exist";
	const REGISTRATION_INVALID_URL = "Invalid URL provided";
	
	//Record constants
	const RECORD_ADDED_SUCCESSFULLY = "Record added successfully";
	const RECORD_EDITED_SUCCESSFULLY = "Record edited successfully";
	const RECORD_STATUS_DELETED_SUCCESSFULLY = "Record deleted successfully";
	const RECORD_NOT_FOUND = "No record found, please <strong> Add New </strong> record";
	const NO_RECORD = "No record found.";
	const BILL_PAID_SUCCESS = "Selected bill(s) set to PAID successfully.";
	const BILL_UNPAID_SUCCESS = "Selected Bill(s) set to UNPAID successfully.";	

	//validation messages
	const VALIDATION_SUCCESS = " OK";
	const VALIDATION_REQUIRED_FIELD = " Should not be empty";
	const VALIDATION_INTEGER_FIELD = " Must be an integer";	
	const VALIDATION_EMAIL_FIELD = " Must be a valid email";	
		
	//round of constant
	const ROUND_RATING = 0; // will give integer value ;)
	
	//password length and error message
	const PASSWORD_MIMIMUM_LENGTH = 6;
	const PASSWORD_MATCH_ERROR = " Passwords doesn't match";
	const PASSWORD_MINIMUM_LENGTH_ERROR = " Password should be atleast 6 charactors long";
	const PASSWORD_RESET_SUCCESSFULLY = "Password reset successfully";
	
	//General
	const PAGE_SIZE_GENERAL = 10;
	const PAGE_SIZE_NOTIFICATIONS = 5;
	const INVALID_REQUEST = "Invalid page request";
	const DB_ERROR = "Some problem occurred, please try again later";	
	
	//Boolean Words YES or No
	const BOOLEAN_WORD_YES = 1;
	const BOOLEAN_WORD_YES_TITLE = 'Yes';
	const BOOLEAN_WORD_NO = 0;
	const BOOLEAN_WORD_NO_TITLE = 'No';

	//General Record status
	const RECORD_STATUS_DELETED = 0;
	const RECORD_STATUS_DELETED_TITLE = 'Deleted';	
	const RECORD_STATUS_ACTIVE = 1;
	const RECORD_STATUS_ACTIVE_TITLE = 'Enabled';	
	const RECORD_STATUS_DEACTIVE = 2;	
	const RECORD_STATUS_DEACTIVE_TITLE = 'Disabled';
	const UNKNOWN_STATUS_TITLE = 'Unknown Status';
	
	//Building Occupied/Vacant Status	
	const BUILDING_VACANT = 0;
	const BUILDING_VACANT_TITLE = 'Vacant';
	const BUILDING_OCCUPIED = 1;
	const BUILDING_OCCUPIED_TITLE = 'Occupied';
	
	//Calculation Value Status
	const SINGLE_PHASE_METER = '1 Phase';
	const THREE_PHASE_METER = '3 Phase';	
	
	const SOLDIER_FREE_UNITS_WINTER = 'winter';
	const SOLDIER_FREE_UNITS_SUMMER = 'summer';
	
	const SOLDIER_FREE_WINTER = 'soldier_winter';
	const SOLDIER_FREE_SUMMER = 'soldier_summer';	
	const JCO_FREE_WINTER = 'jco_winter';
	const JCO_FREE_SUMMER = 'jco_summer';
	
	//Bill Payment Statuses	
	const BILL_UNPAID = 0;
	const BILL_UNPAID_TITLE = 'Unpaid';
	const BILL_PAID = 1;
	const BILL_PAID_TITLE = 'Paid';
	
	static public function GetOccupantStatusArray ()
	{
		$statuses = array (	self::BUILDING_VACANT => self::BUILDING_VACANT_TITLE,
							self::BUILDING_OCCUPIED => self::BUILDING_OCCUPIED_TITLE);
		return $statuses;	
	}
	
	static public function GetOccupantStatusTitle($building_status)
	{
	//Compare Status and return appropriate title.
		switch ($building_status)
		{
			
			case self::BUILDING_VACANT:
				$title = self::BUILDING_VACANT_TITLE;
				break;
			
			case self::BUILDING_OCCUPIED:
				$title = self::BUILDING_OCCUPIED_TITLE;
				break;
			
			default:
				$title = self::UNKNOWN_STATUS_TITLE;
		}			
		return $title;
	}
	
	static public function GetBillPaymentStatusArray ()
	{
		$statuses = array (	self::BILL_UNPAID => self::BILL_UNPAID_TITLE,
							self::BILL_PAID => self::BILL_PAID_TITLE);
		return $statuses;	
	}
	
	static public function GetBillPaymentTitle($bill_status)
	{
	//Compare Status and return appropriate title.
		switch ($bill_status)
		{
			
			case self::BILL_UNPAID:
				$title = self::BILL_UNPAID_TITLE;
				break;
			
			case self::BILL_PAID:
				$title = self::BILL_PAID_TITLE;
				break;
			
			default:
				$title = self::UNKNOWN_STATUS_TITLE;
		}			
		return $title;
	}
	
	
	static public function GetRecordStatusArray ()
	{
		$statuses = array (	self::RECORD_STATUS_ACTIVE => self::RECORD_STATUS_ACTIVE_TITLE,
							self::RECORD_STATUS_DEACTIVE => self::RECORD_STATUS_DEACTIVE_TITLE);
		return $statuses;	
	}

	static public function GetRecordStatusTitle($status)
	{
		//Compare Status and return appropriate title.
		switch ($status)
		{
			case self::RECORD_STATUS_DELETED:
				$title = self::RECORD_STATUS_DELETED_TITLE;
				break;
				
			case self::RECORD_STATUS_ACTIVE:
				$title = self::RECORD_STATUS_ACTIVE_TITLE;
				break;
			
			case self::RECORD_STATUS_DEACTIVE:
				$title = self::RECORD_STATUS_DEACTIVE_TITLE;
				break;
				
			default:
				$title = self::UNKNOWN_STATUS_TITLE;
		}			
		return $title;
	}
	
	static public function GetBooleanWord($boolean)
	{
	//Compare Status and return appropriate title.
		switch ($boolean)
		{
			
			case self::BOOLEAN_WORD_YES:
				$title = self::BOOLEAN_WORD_YES_TITLE;
				break;
			
			case self::BOOLEAN_WORD_NO:
				$title = self::BOOLEAN_WORD_NO_TITLE;
				break;
				
			default:
				$title = self::UNKNOWN_STATUS_TITLE;
		}			
		return $title;
	}
	
}// END - class Constant
?>